package com.yanqu.road.server.gameplayer.module.userinfo.service;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.pb.userinfo.UserInfoProto;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.manger.player.UserMgr;
import com.yanqu.road.sync.message.SyncResponse;

public class UserInfoDetailServiceCmd implements IGameServiceCommand {
    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SyncResponse syncResponse = new SyncResponse();
        UserInfoProto.UserInfoDetailReqMsg reqMsg = UserInfoProto.UserInfoDetailReqMsg.parseFrom(request.getDataBytes());
        UserInfoProto.UserInfoDetailRespMsg.Builder builder = UserInfoProto.UserInfoDetailRespMsg.newBuilder();
        UserMgr.userInfoDetail(reqMsg.getUserId(), reqMsg.getType(), reqMsg.getRelationId(), builder);
        syncResponse.setResponseBuilder(builder);
        return syncResponse;
    }
}
